package com.mytx.notify.sms;

import retrofit2.Retrofit;
import retrofit2.converter.fastjson.FastJsonConverterFactory;

public class RetrofitManager {
    private Retrofit retrofit;

    public RetrofitManager(String baseUrl) {

        retrofit = new Retrofit
                .Builder()
                .baseUrl(baseUrl)
                .addConverterFactory(FastJsonConverterFactory.create())
                .build();
    }

    /**
     * 返回实现类
     *
     * @param reqServer 传入接口类
     * @param <T>
     * @return
     */
    public <T> T createReq(Class<T> reqServer) {
        return retrofit.create(reqServer);
    }
}
